<!DOCTYPE html>
<html>
<head th:include="cultivateWeb/header :: culHeaderCss">
</head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../static/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">
<link type="text/css" href="/css/cultivateWeb/style/my.css" rel="stylesheet">
<body>
<!-- 顶部导航 -->
<header th:include="cultivateWeb/header :: header"></header>
<div style="clear: both"></div>
<div style="background-color: #f7f7f7; ">
    <div class="container">
        <div class="row">
    <div class="layui-container">
        <p style="line-height: 40px">当前位置：<a href="/cultivate/homepage">首页</a> > 学习记录</p>
    </div>
    <hr style="margin: 0 auto  ;"/>
    <section style="display:flex;background:#F7F7F7;padding-top: 0">
        <div class="col-xs-3" style="height: 850px;padding:0;margin-right:10px;background-color: #fff">
            <ul id="personal_data">
                <li><a href="/cultivate/my">个人资料</a></li>
                <li><a href="/cultivate/myOrder">我的订单</a></li>
<!--                <li><a href="/cultivate/myClasss/myClasss">我的班级</a></li>-->
                <li><a href="/cultivate/myCourse">我的课程</a></li>
                <li><a href="/cultivate/myCoursePlan">我的课程计划</a></li>
                <li class="this"><a href="/cultivate/studyRecord">学习记录</a></li>
                <li onclick="recruit()"><a>我的简历</a></li>
                <li><a href="/cultivate/deliverRecord">投递记录</a></li>
                <li><a href="/cultivate/applyRecord">申请记录</a></li>
                <li><a href="/cultivate/myMessage">消息中心</a></li>
                <li><a href="/cultivate/myCertificates">我的证书</a></li>
                <li onclick="mock2(this)" data-type="2"><a>幼儿照护初级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="1"><a>幼儿照护中级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="0"><a>幼儿照护高级模拟考试</a></li>
            </ul>
        </div>
        <div class="col-xs-9" style="padding:0;background-color: #fff">
            <div id="news"></div>
            <div id="page" class="page"></div>
        </div>
        <div style="clear: both"></div>
    </section>
        </div>
    </div>
</div>
<!-- footer ------------------------------------------------------- -->
<div class="footer" th:include="cultivateWeb/header :: footer"></div>
<script type="text/javascript" src="/js/xlPaging.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/mobile.js"></script>
</body>

<script>
    $(function () {
        var is_mobi = navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;

        if(is_mobi){
            $("#personal_data").find('li').eq(9).hide();
            $("#personal_data").find('li').eq(10).hide();
            $("#personal_data").find('li').eq(11).hide();
        }
        ajaxToken("/jzApi/topic/stuRcdList", 'GET',
            {
                current: 1,
                number: 8
            }, function (res) {
                if (res.pages == 0) {
                    $("#news").html('<div class="noData">暂无数据</div>');
                } else {
                    var list = res.records;
                    var news = '';
                    list.forEach(function (item, index) {
                        var a = '';
                        var b = '';
                        if (item.startTime == null) {
                            a = '';
                        } else {
                            a = item.startTime;
                        }
                        if (item.endTime == null) {
                            b = '';
                        } else {
                            b = item.endTime;
                        }
                        news += '<div class="my_bg div_01">' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 5"><span class="title_1">课程名：</span><p id="type" class="title_2">' + item.coursesName + '</p></div>' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">章节名：</span><p id="type" class="title_2">' + item.chapterName + '</p></div>' +
                            '</div>' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 5"><span class="title_1">学习时长：</span><p class="title_2">' + item.duration + '秒</p></div>' +
                            '<div class="span_1" style="flex: 3"><span class="title_1">开始时间：</span><p class="title_2">' + a + '</p></div>' +
                            '<div class="span_1" style="flex: 3"><span class="title_1">结束时间：</span><p class="title_2">' + b + '</p></div>' +
                            '</div>' +
                            // c +
                            '</div>';

                    });
                    $("#news").html(news);
                    page(1, res.pages);
                }
            })
    })

    function page(num, tolPages) {
        $(".page").paging({
            nowPage: Number(num), // 当前页码
            pageNum: Number(tolPages), // 总页码
            buttonNum: 3, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                ajaxToken("/jzApi/topic/stuRcdList", 'GET',
                    {
                        current: num,
                        number: 8
                    }, function (res) {
                        if (res.pages == 0) {
                            $("#news").html('<div class="noData">暂无数据</div>');
                        } else {
                            // console.log(res);
                            var list = res.records;
                            var news = '';
                            list.forEach(function (item, index) {
                                var a = '';
                                var b = '';
                                if (item.startTime == null) {
                                    a = '';
                                } else {
                                    a = item.startTime;
                                }
                                if (item.endTime == null) {
                                    b = '';
                                } else {
                                    b = item.endTime;
                                }
                                news += '<div class="my_bg div_01">' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 5"><span class="title_1">课程名：</span><p id="type" class="title_2">' + item.coursesName + '</p></div>' +
                            '<div class="span_1" style="flex: 6"><span class="title_1">章节名：</span><p id="type" class="title_2">' + item.chapterName + '</p></div>' +
                            '</div>' +
                            '<div style="display: flex;justify-content: space-between">' +
                            '<div class="span_1" style="flex: 5"><span class="title_1">学习时长：</span><p class="title_2">' + item.duration + '秒</p></div>' +
                            '<div class="span_1" style="flex: 3"><span class="title_1">开始时间：</span><p class="title_2">' + a + '</p></div>' +
                            '<div class="span_1" style="flex: 3"><span class="title_1">结束时间：</span><p class="title_2">' + b + '</p></div>' +
                            '</div>' +
                            // c +
                            '</div>';

                            });
                            $("#news").html(news);
                        }
                    });
            }
        });
    }
</script>
</html>